package com.linktrip.devicemanager.util;

public class PageInfo<List> {

	private int totals;

	private List list;

	private int pageNo;

	private int pageSize;

	private int pagesSize;

	public PageInfo(int totals, List list) {
		super();
		this.totals = totals;
		this.list = list;
	}

	public int getTotals() {
		return totals;
	}

	public void setTotals(int totals) {
		this.totals = totals;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPagesSize() {
		return pagesSize;
	}

	public void setPagesSize(int pagesSize) {
		this.pagesSize = pagesSize;
	}

	public int pagesSize() {
		int size = 0;
		if(totals == 0 ) return 0;
		if (totals % pageSize == 0) {
			size = totals / pageSize;
		} else {
			size = totals / pageSize + 1;
		}

		return size;
	}

}
